import java.sql.Connection;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.HashSet;

import org.ueg.dao.Dao;
import org.ueg.dao.DaoReserva;
import org.ueg.model.Assento;
import org.ueg.model.Reserva;


public class PrincipalReserAssento{

	
	public static void main(String[] args) throws SQLException {
		
		
		DaoReserva daoReser = new DaoReserva(null);
		Reserva res = new Reserva();
		Assento ass = new Assento();
		
		
		Calendar c = Calendar.getInstance();
		c.set(Calendar.YEAR, 2014);
		c.set(Calendar.MONTH, Calendar.JUNE);
		c.set(Calendar.DAY_OF_MONTH, 16);
		
		//Salva
		try {
			res.setDataReserva(c);
			ass.setNumeroAssento(56);
			ass.setPreco(90.00);
			ass.setReserv(res);
			
			res.setAssentos(new HashSet<Assento>());
			res.getAssentos().add(ass);
			daoReser.salva(res);
			
			
		} catch (Exception erro) {
			System.out.println("Erro ao inserir! "+erro);
		}
		
	}

}
